import { createParamDecorator, ExecutionContext } from '@nestjs/common';
export const AuthUser = createParamDecorator(//自定义装饰器，返回授权用户信息
    (data: string, ctx: ExecutionContext) => {
        const { user } = ctx.switchToHttp().getRequest();
        return data ? user?.[data] : user;
    });